import request from '@/utils/request'

// 查询项目列表
export function listProject(id) {
  return request({
    url: '/work/competition/getProjectsByCompetitionId',
    method: 'get',
    params: { "competitionId": id }
  })
}

// 查询项目详细
export function getProject(id) {
  return request({
    url: '/work/competition/project/' + id,
    method: 'get'
  })
}

// 新增项目
export function addProject(data) {
  return request({
    url: '/work/competition/project/saveOrUpdate',
    method: 'post',
    data: data
  })
}

// 修改项目
export function updateProject(data) {
  return request({
    url: '/work/competition/project/saveOrUpdate',
    method: 'post',
    data: data
  })
}

// 删除项目
export function delProject(id) {
  return request({
    url: '/work/competition/project/delete-by-id',
    method: 'get',
    params: {
      "id": id
    }
  })
}

export function delProjects(ids) {
  return request({
    url: '/work/competition/project/delete-by-ids',
    method: 'get',
    params: {
      "ids": ids
    }
  })
}

// 项目大类
export function getTypeDic() {
  return request({
    url: '/work/competition/getTypeDic',
    method: 'get'
  })
}

// 项目小类
export function getProjectDic(type) {
  return request({
    url: '/work/competition/getProjectDic',
    method: 'get',
    params: { "type": type }
  })
}

